<template>
<div>
<el-row>
	<el-col :span="3">
		<el-row>
			<el-col :span="8" class="title">神志：</el-col>
			<el-col :span="15">
				<el-select v-model="lifeSign.scene" placeholder="请选择">
					<el-option
						v-for="item in scenes"
						:key="item.value"
						:label="item.label"
						:value="item.value">
					</el-option>
				</el-select>
			</el-col>
		</el-row>
	</el-col>
	<el-col :span="3">
		<el-row>
			<el-col :span="8" class="title">体温：</el-col>
			<el-col :span="15">	
		<el-input placeholder="摄氏度" v-model.lazy="lifeSign.temperature" debounce="3000"></el-input>
			</el-col>
		</el-row>
	</el-col>
	<el-col :span="3">
		<el-row>
			<el-col :span="8" class="title">脉搏：</el-col>
			<el-col :span="15"><el-input placeholder="次/分钟" v-model="lifeSign.pulse"></el-input></el-col>
		</el-row>
	</el-col>
	<el-col :span="3">
		<el-row>
			<el-col :span="8" class="title">呼吸：</el-col>
			<el-col :span="15"><el-input placeholder="次/分钟" v-model="lifeSign.breath"></el-input></el-col>
		</el-row>
	</el-col>
	<el-col :span="3">
		<el-row>
			<el-col :span="8" class="title">血压：</el-col>
			<el-col :span="15">
				<el-row style="background-color:white;border-radius:4px;height:40px;line-height:40px;border:1px solid #dcdfe6;margin-bottom:0px;">
					<el-col :span="11"><el-input class="pressure" v-model="lifeSign.sbp"></el-input></el-col>
					<el-col :span="2" style="text-align:center;background-color: #ffffff;">/</el-col>
					<el-col :span="11"><el-input class="pressure" v-model="lifeSign.dbp"></el-input></el-col>
				</el-row>
			</el-col>
		</el-row>

	</el-col>
	<el-col :span="3">
		<el-row>
			<el-col :span="8" class="title">发育：</el-col>
			<el-col :span="15">
				<el-select v-model="lifeSign.growth" placeholder="请选择">
						<el-option
						v-for="item in growths"
						:key="item.value"
						:label="item.label"
						:value="item.value">
					</el-option>
				</el-select>
			</el-col>
		</el-row>
	</el-col>
	<el-col :span="3">
		<el-row>
			<el-col :span="8" class="title">面容：</el-col>
			<el-col :span="16">
				<el-cascader
    				expand-trigger="hover"
    				:options="expressions"
    				v-model="lifeSign.expression">
  				</el-cascader>
			</el-col>
		</el-row>
	</el-col>
	<el-col :span="3" v-show="ageType != '1岁内婴儿'">
		<el-row>
			<el-col :span="8" class="title">体位：</el-col>
			<el-col :span="15"  style="text-align:left;">
				<el-cascader
    				expand-trigger="hover"
    				:options="positions"
    				v-model="lifeSign.position">
  				</el-cascader>
			</el-col>
		</el-row>
	</el-col>
</el-row>
<el-row>
	<el-col :span="3">
		<el-row>
			<el-col :span="8" class="title">营养：</el-col>
			<el-col :span="15">
				<el-select v-model="lifeSign.nutrition" placeholder="请选择">
						<el-option
						v-for="item in nutritions"
						:key="item.value"
						:label="item.label"
						:value="item.value">
					</el-option>
				</el-select>
			</el-col>
		</el-row>
	</el-col>
	<el-col :span="4">
		<el-row>
			<el-col :span="7" class="title">过敏史：</el-col>
			<el-col :span="17">
				 <el-select
				    v-model="lifeSign.allergy"
				    multiple
				    collapse-tags
				    placeholder="请选择">
				    <el-option
				      v-for="item in allergys"
				      :key="item.value"
				      :label="item.label"
				      :value="item.value">
				    </el-option>
				  </el-select>
			</el-col>
		</el-row>
	</el-col>
	<el-col :span="4">
		<el-row>
			<el-col :span="9" class="title">发病时间：</el-col>
			<el-col :span="7"><el-input placeholder="" v-model="diseaseTime"></el-input></el-col>
			<el-col  :span="8">
				<el-select v-model="timeUnit" placeholder="请选择">
					<el-option
					v-for="item in timeUnits"
					:key="item.value"
					:label="item.label"
					:value="item.value">
					</el-option>
				</el-select>
			</el-col>
		</el-row>
	</el-col>
	<el-col :span="3">
		<el-row>
			<el-col :span="9" class="title">地点：</el-col>
			<el-col :span="13">
				<el-select v-model="handlePlace" placeholder="请选择">
					<el-option
					v-for="item in handlePlaces"
					:key="item.value"
					:label="item.label"
					:value="item.value">
					</el-option>
				</el-select>
			</el-col>
		</el-row>
	</el-col>
	<!-- <el-col :span="3">
		<el-row>
			<el-col :span="9" class="title">待诊中：</el-col>
			<el-col :span="15">
				<el-select placeholder="请选择" v-model="curPengding">
					<el-option
					v-for="item in pending"
					:key="item.value"
					:label="item.label"
					:value="item.value">
					</el-option>
				</el-select>
			</el-col>
		</el-row>
	</el-col> -->
	<el-col :span="3">
		<el-row>
			<el-col :span="9" class="title">检查中：</el-col>
			<el-col :span="15">
				<el-select placeholder="请选择" v-model="curChecking" value-key="recordId" @change="rebindData">
					<el-option
					v-for="item in checking"
					:key="item.recordId"
					:label="item.recordName"
					:value="item">
					</el-option>
				</el-select>
			</el-col>
		</el-row>
	</el-col>
	<el-col :span="5">
		<el-row>
			<el-col :span="5" class="title">转诊：</el-col>
			<el-col :span="10">
				<el-cascader
    				expand-trigger="hover"
    				:options="referralHospitals"
    				v-model="referralHospital">
  				</el-cascader>
			</el-col>
			<el-col :span="8">
				<el-input v-show="isShowElse" placeholder="请输入其他医院" v-model="elseHospital"></el-input>
			</el-col>
		</el-row>
	</el-col>
</el-row>
</div>
</template>
<script type="text/javascript">
export default{
	name:'VitalSign',
	data() {
		return {
			isRealTime:true,
			emergencyGroup:[],
			curChecking:'',
			curPengding:'',
			timeUnit:'',
			diseaseTime:'',
			handlePlace:'',
			isShowElse:false,
			elseHospital:'',
			referralHospital:[],
			lifeRanks: '',
			scenes: [],
			expressions: [],
			growths:[],
			vitalSigns:[],
			vitalGroups:'',
			lifeSign: {
				temperature:'',
				scene:'',
				growth:'',
				position: [],
				pulse: '',
				breath: '',
				sbp: '',
				dbp: '',
				nutrition: '',
				expression: [],
				allergy:''
			},
			childGrowths: [{
				value: '发育正常',
				label: '发育正常'
			},{
				value: '发育不良',
				label: '发育不良'
			}],
			adultGrowths: [{
				value: '发育正常',
				label: '发育正常'
			},{
				value: '高大型体型',
				label: '高大型体型'
			},{
				value: '矮小型体型',
				label: '矮小型体型'
			}],
			nutritions: [{
				value: '营养良好',
				label: '营养良好'
			},{
				value: '营养中等',
				label: '营养中等'
			},{
				value: '营养不良',
				label: '营养不良'
			},{
				value: '营养过度:肥胖',
				label: '营养过度:肥胖'
			}],
			adultExpressions: [{
				value: '表情正常',
				label: '表情正常'
			},{
				value: '表情抑郁',
				label: '表情抑郁'
			},{
				value: '表情焦虑',
				label: '表情焦虑'
			},{
				value: '急性病容',
				label: '急性病容'
			},{
				value: '慢性病容',
				label: '慢性病容'
			},{
				value: '贫血面容',
				label: '贫血面容'
			},{
				value: '表情痛苦',
				label: '表情痛苦'
			},{
				value: '特殊面容',
				label: '特殊面容',
				children:[{
				value: '肝病面容',
				label: '肝病面容'
				},{
					value: '肾病面容',
					label: '肾病面容'
				},{
					value: '甲状腺功能亢进面容',
					label: '甲状腺功能亢进面容'
				},{
					value: '二尖瓣面容',
					label: '二尖瓣面容'
				},{
					value: '苦笑面容',
					label: '苦笑面容'
				},{
					value: '满月面容',
					label: '满月面容'
				}]
			}],
			childExpressions: [{
				value: '正常',
				label: '正常'
			},{
				value: '急性病容',
				label: '急性病容'
			},{
				value: '青紫',
				label: '青紫'
			},{
				value: '慢性病容',
				label: '慢性病容'
			},{
				value: '苍白',
				label: '苍白'
			},{
				value: '黄染',
				label: '黄染'
			}],
			positions: [{
          			value: '自动体位',
          			label: '自动体位',
        		},{
          			value: '被动体位',
          			label: '被动体位',
        		},{
          			value: '强迫体位',
          			label: '强迫体位',
          			children: [{
            				value: '强迫仰卧位',
            				label: '强迫仰卧位'
          					},{
            				value: '强迫侧卧位',
            				label: '强迫侧卧位'
          					},{
            				value: '端坐位',
            				label: '端坐位'
          					},{
            				value: '强迫蹲位',
            				label: '强迫蹲位'
          					},{
            				value: '强迫停立位',
            				label: '强迫停立位'
          					},{
            				value: '辗转体位',
            				label: '辗转体位'
          					},{
            				value: '角弓反张位',
            				label: '角弓反张位'
          					}] 
          			}],
          	adultSenses: [{
					value: '神志清晰',
					label: '神志清晰'
				}, {
					value: '嗜睡',
					label: '嗜睡'
				}, {
					value: '意识模糊',
					label: '意识模糊'
				}, {
					value: '昏睡',
					label: '昏睡'
				}, {
					value: '谵妄',
					label: '谵妄'
				}, {
					value: '昏迷',
					label: '昏迷'
				}, {
					value: '突发意识丧失',
					label: '突发意识丧失'
				}],
			childSenses: [{
					value: '神志清晰',
					label: '神志清晰'
				}, {
					value: '活泼、好动',
					label: '活泼、好动'
				}, {
					value: '哭闹、不配合',
					label: '哭闹、不配合'
				}, {
					value: '嗜睡',
					label: '嗜睡'
				}, {
					value: '意识模糊',
					label: '意识模糊'
				}, {
					value: '昏睡',
					label: '昏睡'
				}, {
					value: '惊厥',
					label: '惊厥'
				}, {
					value: '昏迷',
					label: '昏迷'
				}],
				handlePlaces:[{
					label: "门诊",
					value: "门诊"
				},{
					label: "出诊",
					value: "出诊"
				}],
				referralHospitals: [{
          			value: '双向转诊【转出】',
          			label: '双向转诊【转出】',
          			children:[{
          			value: '一级医院',
          			label: '一级医院',
          			children: [{
            				value: '一级医院A',
            				label: '一级医院A'
          					},{
            				value: '一级医院B',
            				label: '一级医院B'
          					},{
            				value: '一级医院C',
            				label: '一级医院C'
          					},{
            				value: '其他一级医院',
            				label: '其他一级医院'
          					}]
        		},{
          			value: '二级医院',
          			label: '二级医院',
          			children: [{
            				value: '二级医院A',
            				label: '二级医院A'
          					},{
            				value: '二级医院B',
            				label: '二级医院B'
          					},{
            				value: '二级医院C',
            				label: '二级医院C'
          					},{
            				value: '其他二级医院',
            				label: '其他二级医院'
          					}] 
          		},{
          			value: '三级医院',
          			label: '三级医院',
          			children: [{
            				value: '三级医院A',
            				label: '三级医院A'
          					},{
            				value: '三级医院B',
            				label: '三级医院B'
          					},{
            				value: '三级医院C',
            				label: '三级医院C'
          					},{
            				value: '其他三级医院',
            				label: '其他三级医院'
          					}] 
          		},{
          			value: '其他医院',
          			label: '其他医院'
          		}]
          		},{
          			value: '双向转诊【转回】',
          			label: '双向转诊【转回】'
          		},{
          			value: '其他医院',
          			label: '其他医院'
          		}],
          		timeUnits:[{
          			value: '分钟',
            		label: '分钟'
          		},{
          			value: '小时',
            		label: '小时'
          		},{
          			value: '天',
            		label: '天'
          		},{
          			value: '月',
            		label: '月'
          		},{
          			value: '年',
            		label: '年'
          		}],
          		pending: [{
          			value: '患者A',
            		label: '患者A'
          		},{
          			value: '患者B',
            		label: '患者B'
          		},{
          			value: '患者C',
            		label: '患者C'
          		}],
          		checking: [{
          			value: '患者D',
            		label: '患者D'
          		}],
          		allergys:[{
          			value: '无药物过敏史',
            		label: '无药物过敏史'
          		},{
          			value: '青霉素',
            		label: '青霉素'
          		},{
          			value: '链霉素',
            		label: '链霉素'
          		},{
          			value: '头孢菌素',
            		label: '头孢菌素'
          		},{
          			value: '破伤风抗毒素',
            		label: '破伤风抗毒素'
          		},{
          			value: '盐酸普鲁卡因',
            		label: '盐酸普鲁卡因'
          		},{
          			value: '磺胺类',
            		label: '磺胺类'
          		},{
          			value: '喹诺酮类药',
            		label: '喹诺酮类药'
          		}]
		}
	},
	computed:{
		age(){
			return this.$store.state.age;
		},
		ageType(){
			return this.$store.state.ageType;
		},
		curUser(){
			return this.$store.state.curUser;
		}
	},
	methods:{
		getVitalSigns:function(){
			//清空一次生命体征得到的症状
			//然后再重新计算赋值
			this.vitalSigns = [];
			//清空生命体征信号灯，再遍历赋值
			this.lifeRanks = '';
			var vitalGroups = '';
			//神志判断
			if(this.lifeSign.scene != ''){
				var childSceneMap = new Map();
				var adultSceneMap = new Map();
				childSceneMap.set("神志清晰","aa1");
				childSceneMap.set("活泼、好动","aa2");
				childSceneMap.set("哭闹、不配合","aa3");
				childSceneMap.set("嗜睡","aa4");
				childSceneMap.set("意识模糊","aa5");
				childSceneMap.set("昏睡","aa6");
				childSceneMap.set("谵妄","aa7");
				childSceneMap.set("昏迷","aa8");

				adultSceneMap.set("神志清晰","a1");
				adultSceneMap.set("嗜睡","a2");
				adultSceneMap.set("意识模糊","a3");
				adultSceneMap.set("昏睡","a4");
				adultSceneMap.set("躁动、谵妄","a5");
				adultSceneMap.set("昏迷","a6");
				adultSceneMap.set("突发意识丧失","a7");

				if(this.ageType != '成人'){
					//儿童类
					if (this.lifeSign.scene == '神志清晰' || this.lifeSign.scene == '活泼、好动') {
						this.lifeRanks = this.lifeRanks + '1';
					}else if(this.lifeSign.scene == '哭闹、不配合'){
						this.lifeRanks = this.lifeRanks + '2';
					}else if(this.lifeSign.scene == '嗜睡' || this.lifeSign.scene == '意识模糊' || this.lifeSign.scene == '昏睡'){
						this.lifeRanks = this.lifeRanks + '3';
					}else if(this.lifeSign.scene == '昏迷' || this.lifeSign.scene == '惊厥'){
						this.lifeRanks = this.lifeRanks + '4';
					}
					vitalGroups = vitalGroups + childSceneMap.get(this.lifeSign.scene) + ',';
				}else{
					//成人类
					if (this.lifeSign.scene == '神志清晰') {
						this.lifeRanks = this.lifeRanks + '1';
					}else if(this.lifeSign.scene == '嗜睡' || this.lifeSign.scene == '意识模糊' || this.lifeSign.scene == '昏睡'){
						this.lifeRanks = this.lifeRanks + '3';
					}else if(this.lifeSign.scene == '躁动、谵妄' || this.lifeSign.scene == '昏迷' || this.lifeSign.scene == '突发意识丧失'){
						this.lifeRanks = this.lifeRanks + '4';
					}
					vitalGroups = vitalGroups + adultSceneMap.get(this.lifeSign.scene) + ','
				}
				this.vitalSigns.push({
					labelName:'scene',
					symptomName:'神志：'+this.lifeSign.scene
				});
			}

			//判断体温
			if(this.lifeSign.temperature != ''){
				var temperatureTip = '';
				if (this.ageType != '成人') {
					//儿童类
					if (this.lifeSign.temperature >= 36 && this.lifeSign.temperature <=37.4) {
						this.lifeRanks = this.lifeRanks + '1';
						vitalGroups = vitalGroups + 'bb1,';
					}else if(this.lifeSign.temperature >= 37.5 && this.lifeSign.temperature <=38){
						this.lifeRanks = this.lifeRanks + '2';
						vitalGroups = vitalGroups + 'bb2,';
					}else if(this.lifeSign.temperature > 38 && this.lifeSign.temperature <=39){
						this.lifeRanks = this.lifeRanks + '3';
						vitalGroups = vitalGroups + 'bb3,';
					}else if(this.lifeSign.temperature > 39 && this.lifeSign.temperature <=40.5){
						this.lifeRanks = this.lifeRanks + '3';
						vitalGroups = vitalGroups + 'bb4,';
					}else if(this.lifeSign.temperature >= 35 && this.lifeSign.temperature <36){
						this.lifeRanks = this.lifeRanks + '3';
						vitalGroups = vitalGroups + 'bb5,';
					}else if(this.lifeSign.temperature > 40.5){
						this.lifeRanks = this.lifeRanks + '4';
						vitalGroups = vitalGroups + 'bb6,';
					}else if(this.lifeSign.temperature < 35){
						this.lifeRanks = this.lifeRanks + '4';
						vitalGroups = vitalGroups + 'bb7,';
					}

				}else{
					//成人类
					if (this.lifeSign.temperature >= 36 && this.lifeSign.temperature <=37.2) {
						this.lifeRanks = this.lifeRanks + '1';
						vitalGroups = vitalGroups + 'b1,';
					}else if(this.lifeSign.temperature > 37.2 && this.lifeSign.temperature <=38){
						this.lifeRanks = this.lifeRanks + '2';
						temperatureTip = '低热';
						vitalGroups = vitalGroups + 'b2,';
					}else if(this.lifeSign.temperature > 38 && this.lifeSign.temperature <=39){
						this.lifeRanks = this.lifeRanks + '2';
						temperatureTip = '高热';
						vitalGroups = vitalGroups + 'b3,';
					}else if(this.lifeSign.temperature > 39 && this.lifeSign.temperature <=41){
						this.lifeRanks = this.lifeRanks + '3';
						temperatureTip = '高热';
						vitalGroups = vitalGroups + 'b4,';
					}else if(this.lifeSign.temperature >= 35.5 && this.lifeSign.temperature <36){
						this.lifeRanks = this.lifeRanks + '3';
						vitalGroups = vitalGroups + 'b5,';
					}else if (this.lifeSign.temperature > 41){
						this.lifeRanks = this.lifeRanks + '4';
						temperatureTip = '超高热';
						vitalGroups = vitalGroups + 'b6,';
					}else{
						this.lifeRanks = this.lifeRanks + '4';
						vitalGroups = vitalGroups + 'b7,';
					}
				}
				this.vitalSigns.push({
					labelName:'temperature',
					symptomName:'体温：'+this.lifeSign.temperature + '℃' + temperatureTip
				});
			}

			//判断脉搏
			if(this.lifeSign.pulse != ''){
				if (this.ageType != '成人') {
					//儿童类
					if (this.ageType == '1岁内婴儿') {
						//1岁内婴儿
						if (this.lifeSign.pulse >160) {
							this.lifeRanks = this.lifeRanks + '4';
							vitalGroups = vitalGroups + 'cc1,';
						}else if (this.lifeSign.pulse > 150 && this.lifeSign.pulse <= 160) {
							this.lifeRanks = this.lifeRanks + '3';
							vitalGroups = vitalGroups + 'cc2,';
						}else if (this.lifeSign.pulse > 130 && this.lifeSign.pulse <= 150) {
							this.lifeRanks = this.lifeRanks + '2';
							vitalGroups = vitalGroups + 'cc3,';
						}else if (this.lifeSign.pulse >= 110 && this.lifeSign.pulse <= 130) {
							this.lifeRanks = this.lifeRanks + '1';
							vitalGroups = vitalGroups + 'cc4,';
						}else if (this.lifeSign.pulse >= 100 && this.lifeSign.pulse < 110) {
							this.lifeRanks = this.lifeRanks + '2';
							vitalGroups = vitalGroups + 'cc5,';
						}else if (this.lifeSign.pulse < 100 && this.lifeSign.pulse >= 90) {
							this.lifeRanks = this.lifeRanks + '4';
							vitalGroups = vitalGroups + 'cc6,';
						}else if (this.lifeSign.pulse < 90) {
							this.lifeRanks = this.lifeRanks + '4';
							vitalGroups = vitalGroups + 'cc7,';
						}
					}else if(this.age >=1 && this.age <=3){
						//1-3岁
						if (this.lifeSign.pulse >160) {
							this.lifeRanks = this.lifeRanks + '4';
							vitalGroups = vitalGroups + 'cc8,';
						}else if (this.lifeSign.pulse > 150 && this.lifeSign.pulse <= 160) {
							this.lifeRanks = this.lifeRanks + '3';
							vitalGroups = vitalGroups + 'cc9,';
						}else if (this.lifeSign.pulse > 120 && this.lifeSign.pulse <= 150) {
							this.lifeRanks = this.lifeRanks + '2';
							vitalGroups = vitalGroups + 'cc10,';
						}else if (this.lifeSign.pulse >= 100 && this.lifeSign.pulse <= 120) {
							this.lifeRanks = this.lifeRanks + '1';
							vitalGroups = vitalGroups + 'cc11,';
						}else if (this.lifeSign.pulse >= 90 && this.lifeSign.pulse < 100) {
							this.lifeRanks = this.lifeRanks + '2';
							vitalGroups = vitalGroups + 'cc12,';
						}else if (this.lifeSign.pulse >= 40 && this.lifeSign.pulse < 90) {
							this.lifeRanks = this.lifeRanks + '3';
							vitalGroups = vitalGroups + 'cc13,';
						}else if (this.lifeSign.pulse < 80) {
							this.lifeRanks = this.lifeRanks + '4';
							vitalGroups = vitalGroups + 'cc14,';
						}
					}else if (this.age >=4 && this.age <=7){
						//4-7岁
						if (this.lifeSign.pulse >=150) {
							this.lifeRanks = this.lifeRanks + '4';
							vitalGroups = vitalGroups + 'cc15,';
						}else if (this.lifeSign.pulse > 130 && this.lifeSign.pulse <= 150) {
							this.lifeRanks = this.lifeRanks + '3';
							vitalGroups = vitalGroups + 'cc16,';
						}else if (this.lifeSign.pulse > 100 && this.lifeSign.pulse <= 130) {
							this.lifeRanks = this.lifeRanks + '2';
							vitalGroups = vitalGroups + 'cc17,';
						}else if (this.lifeSign.pulse >= 80 && this.lifeSign.pulse <= 100) {
							this.lifeRanks = this.lifeRanks + '1';
							vitalGroups = vitalGroups + 'cc18,';
						}else if (this.lifeSign.pulse >= 70 && this.lifeSign.pulse < 80) {
							this.lifeRanks = this.lifeRanks + '2';
							vitalGroups = vitalGroups + 'cc19,';
						}else if (this.lifeSign.pulse >= 60 && this.lifeSign.pulse < 70) {
							this.lifeRanks = this.lifeRanks + '3';
							vitalGroups = vitalGroups + 'cc20,';
						}else if (this.lifeSign.pulse < 60) {
							this.lifeRanks = this.lifeRanks + '4';
							vitalGroups = vitalGroups + 'cc21,';
						}
					}else{
						//8-14岁
						if (this.lifeSign.pulse >=150) {
							this.lifeRanks = this.lifeRanks + '4';
							vitalGroups = vitalGroups + 'cc22,';
						}else if (this.lifeSign.pulse > 120 && this.lifeSign.pulse <= 150) {
							this.lifeRanks = this.lifeRanks + '3';
							vitalGroups = vitalGroups + 'cc23,';
						}else if (this.lifeSign.pulse > 90 && this.lifeSign.pulse <= 120) {
							this.lifeRanks = this.lifeRanks + '2';
							vitalGroups = vitalGroups + 'cc24,';
						}else if (this.lifeSign.pulse >= 70 && this.lifeSign.pulse <= 90) {
							this.lifeRanks = this.lifeRanks + '1';
							vitalGroups = vitalGroups + 'cc25,';
						}else if (this.lifeSign.pulse >= 60 && this.lifeSign.pulse < 70) {
							this.lifeRanks = this.lifeRanks + '2';
							vitalGroups = vitalGroups + 'cc26,';
						}else if (this.lifeSign.pulse >= 50 && this.lifeSign.pulse < 60) {
							this.lifeRanks = this.lifeRanks + '3';
							vitalGroups = vitalGroups + 'cc27,';
						}else if (this.lifeSign.pulse < 50) {
							this.lifeRanks = this.lifeRanks + '4';
							vitalGroups = vitalGroups + 'cc28,';
						}
					}
				}else{
					//成人类
					if (this.lifeSign.pulse >=60 && this.lifeSign.pulse <=100) {
							this.lifeRanks = this.lifeRanks + '1';
							vitalGroups = vitalGroups + 'c1,';
						}else if (this.lifeSign.pulse >= 40 && this.lifeSign.pulse < 60) {
							this.lifeRanks = this.lifeRanks + '2';
							vitalGroups = vitalGroups + 'c2,';
						}else if (this.lifeSign.pulse > 100 && this.lifeSign.pulse <= 130) {
							this.lifeRanks = this.lifeRanks + '2';
							vitalGroups = vitalGroups + 'c3,';
						}else if (this.lifeSign.pulse >= 35 && this.lifeSign.pulse < 40) {
							this.lifeRanks = this.lifeRanks + '3';
							vitalGroups = vitalGroups + 'c5,';
						}else if (this.lifeSign.pulse > 130 && this.lifeSign.pulse <= 150) {
							this.lifeRanks = this.lifeRanks + '3';
							vitalGroups = vitalGroups + 'c4,';
						}else if (this.lifeSign.pulse < 35&&this.lifeSign.pulse > 0) {
							this.lifeRanks = this.lifeRanks + '4';
							vitalGroups = vitalGroups + 'c7,';
						}else if (this.lifeSign.pulse > 150) {
							this.lifeRanks = this.lifeRanks + '4';
							vitalGroups = vitalGroups + 'c6,';
						}else if (this.lifeSign.pulse == 0) {
							this.lifeRanks = this.lifeRanks + '4';
							vitalGroups = vitalGroups + 'c8,';
						}
				}
				this.vitalSigns.push({
					labelName:'pulse',
					symptomName:'脉搏：'+this.lifeSign.pulse + '次/分'
				});
			}

			//判断呼吸
			if(this.lifeSign.breath != ''){
				if (this.ageType != '成人') {
					//儿童类
					if (this.ageType == '1岁内婴儿') {
						//1岁内婴儿
						if (this.lifeSign.breath > 60) {
							this.lifeRanks = this.lifeRanks + '4';
							vitalGroups = vitalGroups + 'dd1,';
						}else if (this.lifeSign.breath > 50 && this.lifeSign.breath <= 60) {
							this.lifeRanks = this.lifeRanks + '3';
							vitalGroups = vitalGroups + 'dd2,';
						}else if (this.lifeSign.breath > 40 && this.lifeSign.breath <= 50) {
							this.lifeRanks = this.lifeRanks + '2';
							vitalGroups = vitalGroups + 'dd3,';
						}else if (this.lifeSign.breath >= 30 && this.lifeSign.breath <= 40) {
							this.lifeRanks = this.lifeRanks + '1';
							vitalGroups = vitalGroups + 'dd4,';
						}else if (this.lifeSign.breath >= 25 && this.lifeSign.breath < 30) {
							this.lifeRanks = this.lifeRanks + '2';
							vitalGroups = vitalGroups + 'dd5,';
						}else if (this.lifeSign.breath >= 20 && this.lifeSign.breath < 25) {
							this.lifeRanks = this.lifeRanks + '3';
							vitalGroups = vitalGroups + 'dd6,';
						}else if (this.lifeSign.breath < 20) {
							this.lifeRanks = this.lifeRanks + '4';
							vitalGroups = vitalGroups + 'dd7,';
						}
					}else if(this.age >=1 && this.age <=3){
						//1-3岁
						if (this.lifeSign.breath > 50) {
							this.lifeRanks = this.lifeRanks + '4';
							vitalGroups = vitalGroups + 'dd8,';
						}else if (this.lifeSign.breath > 40 && this.lifeSign.breath <= 50) {
							this.lifeRanks = this.lifeRanks + '3';
							vitalGroups = vitalGroups + 'dd9,';
						}else if (this.lifeSign.breath > 30 && this.lifeSign.breath <= 40) {
							this.lifeRanks = this.lifeRanks + '2';
							vitalGroups = vitalGroups + 'dd10,';
						}else if (this.lifeSign.breath >= 25 && this.lifeSign.breath <= 30) {
							this.lifeRanks = this.lifeRanks + '1';
							vitalGroups = vitalGroups + 'dd11,';
						}else if (this.lifeSign.breath >= 20 && this.lifeSign.breath < 25) {
							this.lifeRanks = this.lifeRanks + '2';
							vitalGroups = vitalGroups + 'dd12,';
						}else if (this.lifeSign.breath >= 15 && this.lifeSign.breath < 20) {
							this.lifeRanks = this.lifeRanks + '3';
							vitalGroups = vitalGroups + 'dd13,';
						}else if (this.lifeSign.breath < 15) {
							this.lifeRanks = this.lifeRanks + '4';
							vitalGroups = vitalGroups + 'dd14,';
						}
					}else if(this.age >=4 && this.age <=7){
						//4-7岁
						if (this.lifeSign.breath > 50) {
							this.lifeRanks = this.lifeRanks + '4';
							vitalGroups = vitalGroups + 'dd15,';
						}else if (this.lifeSign.breath >40 && this.lifeSign.breath <= 50) {
							this.lifeRanks = this.lifeRanks + '3';
							vitalGroups = vitalGroups + 'dd16,';
						}else if (this.lifeSign.breath > 25 && this.lifeSign.breath <= 40) {
							this.lifeRanks = this.lifeRanks + '2';
							vitalGroups = vitalGroups + 'dd17,';
						}else if (this.lifeSign.breath >= 20 && this.lifeSign.breath < 25) {
							this.lifeRanks = this.lifeRanks + '1';
							vitalGroups = vitalGroups + 'dd18,';
						}else if (this.lifeSign.breath > 14 && this.lifeSign.breath < 20) {
							this.lifeRanks = this.lifeRanks + '2';
							vitalGroups = vitalGroups + 'dd19,';
						}else if (this.lifeSign.breath >= 10 && this.lifeSign.breath < 15) {
							this.lifeRanks = this.lifeRanks + '3';
							vitalGroups = vitalGroups + 'dd20,';
						}else if (this.lifeSign.breath < 10) {
							this.lifeRanks = this.lifeRanks + '4';
							vitalGroups = vitalGroups + 'dd21,';
						}
					}else{
						//8-14岁
						if (this.lifeSign.breath > 40) {
							this.lifeRanks = this.lifeRanks + '4';
							vitalGroups = vitalGroups + 'dd22,';
						}else if (this.lifeSign.breath >30 && this.lifeSign.breath <= 40) {
							this.lifeRanks = this.lifeRanks + '3';
							vitalGroups = vitalGroups + 'dd23,';
						}else if (this.lifeSign.breath > 20 && this.lifeSign.breath <= 30) {
							this.lifeRanks = this.lifeRanks + '2';
							vitalGroups = vitalGroups + 'dd24,';
						}else if (this.lifeSign.breath >= 18 && this.lifeSign.breath <= 20) {
							this.lifeRanks = this.lifeRanks + '1';
							vitalGroups = vitalGroups + 'dd25,';
						}else if (this.lifeSign.breath > 14 && this.lifeSign.breath <= 17) {
							this.lifeRanks = this.lifeRanks + '2';
							vitalGroups = vitalGroups + 'dd26,';
						}else if (this.lifeSign.breath >= 10 && this.lifeSign.breath < 15) {
							this.lifeRanks = this.lifeRanks + '3';
							vitalGroups = vitalGroups + 'dd27,';
						}else if (this.lifeSign.breath < 10) {
							this.lifeRanks = this.lifeRanks + '4';
							vitalGroups = vitalGroups + 'dd28,';
						}
					}
				}else{
					//成人类
					if (this.lifeSign.breath >=12 && this.lifeSign.breath <=20) {
							this.lifeRanks = this.lifeRanks + '1';
							vitalGroups = vitalGroups + 'd1,';
						}else if (this.lifeSign.breath >= 10 && this.lifeSign.breath < 13) {
							this.lifeRanks = this.lifeRanks + '2';
							vitalGroups = vitalGroups + 'd3,';
						}else if (this.lifeSign.breath > 20 && this.lifeSign.breath <= 25) {
							this.lifeRanks = this.lifeRanks + '2';
							vitalGroups = vitalGroups + 'd2,';
						}else if (this.lifeSign.breath >= 8 && this.lifeSign.breath < 11) {
							this.lifeRanks = this.lifeRanks + '3';
							vitalGroups = vitalGroups + 'd5,';
						}else if (this.lifeSign.breath > 25 && this.lifeSign.breath <= 30) {
							this.lifeRanks = this.lifeRanks + '3';
							vitalGroups = vitalGroups + 'd4,';
						}else if (this.lifeSign.breath < 5&&this.lifeSign.breath > 0) {
							this.lifeRanks = this.lifeRanks + '4';
							vitalGroups = vitalGroups + 'd9,';
						}else if (this.lifeSign.breath > 30 && this.lifeSign.breath <= 35) {
							this.lifeRanks = this.lifeRanks + '4';
							vitalGroups = vitalGroups + 'd6,';
						}else if (this.lifeSign.breath >= 5 && this.lifeSign.breath <= 7) {
							this.lifeRanks = this.lifeRanks + '4';
							vitalGroups = vitalGroups + 'd7,';
						}else if (this.lifeSign.breath > 35) {
							this.lifeRanks = this.lifeRanks + '4';
							vitalGroups = vitalGroups + 'd8,';
						}else if (this.lifeSign.breath == 0) {
							this.lifeRanks = this.lifeRanks + '4';
							vitalGroups = vitalGroups + 'd10,';
						}
				}
				this.vitalSigns.push({
					labelName:'breath',
					symptomName:'呼吸：'+this.lifeSign.breath + '次/分'
				});
			}

			//判断血压
			if(this.lifeSign.sbp != '' && this.lifeSign.dbp != ''){
				var sdbpTip = '';
				if (this.ageType != '成人') {
					//儿童类
					if (this.ageType == '1岁内婴儿') {
						//1岁内婴儿
						if (this.lifeSign.sbp >= 75 && this.lifeSign.sbp <= 120 && this.lifeSign.dbp >= 50 && this.lifeSign.dbp <= 80) {
							this.lifeRanks = this.lifeRanks + '2';
							vitalGroups = vitalGroups + 'ee1,';
						}else if (this.lifeSign.sbp >= 70 && this.lifeSign.sbp < 75 && this.lifeSign.dbp >= 47 && this.lifeSign.dbp < 50) {
							this.lifeRanks = this.lifeRanks + '3';
							vitalGroups = vitalGroups + 'ee2,';
						}else if (this.lifeSign.sbp < 70 && this.lifeSign.dbp < 47) {
							this.lifeRanks = this.lifeRanks + '4';
							vitalGroups = vitalGroups + 'ee3,';
						}else if (this.lifeSign.sbp > 120 && this.lifeSign.dbp > 80) {
							this.lifeRanks = this.lifeRanks + '4';
							vitalGroups = vitalGroups + 'ee4,';
						}
					}else if(this.age >=1 && this.age <=3){
						//1-3岁
						if (this.lifeSign.sbp >= 82 && this.lifeSign.sbp <= 120 && this.lifeSign.dbp >= 55 && this.lifeSign.dbp <= 80) {
							this.lifeRanks = this.lifeRanks + '2';
							vitalGroups = vitalGroups + 'ee5,';
						}else if (this.lifeSign.sbp >= 73 && this.lifeSign.sbp < 82 && this.lifeSign.dbp >= 49 && this.lifeSign.dbp < 55) {
							this.lifeRanks = this.lifeRanks + '3';
							vitalGroups = vitalGroups + 'ee6,';
						}else if (this.lifeSign.sbp < 73 && this.lifeSign.dbp < 49) {
							this.lifeRanks = this.lifeRanks + '4';
							vitalGroups = vitalGroups + 'ee7,';
						}else if (this.lifeSign.sbp > 120 && this.lifeSign.dbp > 80) {
							this.lifeRanks = this.lifeRanks + '4';
							vitalGroups = vitalGroups + 'ee8,';
						}
					}else if(this.age >=4 && this.age <=7){
						//4-7岁
						if (this.lifeSign.sbp >= 88 && this.lifeSign.sbp <= 120 && this.lifeSign.dbp >= 59 && this.lifeSign.dbp <= 80) {
							this.lifeRanks = this.lifeRanks + '2';
							vitalGroups = vitalGroups + 'ee9,';
						}else if (this.lifeSign.sbp >= 75 && this.lifeSign.sbp < 88 && this.lifeSign.dbp >= 50 && this.lifeSign.dbp < 59) {
							this.lifeRanks = this.lifeRanks + '3';
							vitalGroups = vitalGroups + 'ee10,';
						}else if (this.lifeSign.sbp < 75 && this.lifeSign.dbp < 50) {
							this.lifeRanks = this.lifeRanks + '4';
							vitalGroups = vitalGroups + 'ee11,';
						}else if (this.lifeSign.sbp > 120 && this.lifeSign.dbp > 80) {
							this.lifeRanks = this.lifeRanks + '4';
							vitalGroups = vitalGroups + 'ee12,';
						}
					}else if(this.age >=8 && this.age <=14){
						//8-14岁
						if (this.lifeSign.sbp >= 96 && this.lifeSign.sbp <= 120 && this.lifeSign.dbp >= 64 && this.lifeSign.dbp <= 80) {
							this.lifeRanks = this.lifeRanks + '2';
							vitalGroups = vitalGroups + 'ee13,';
						}else if (this.lifeSign.sbp >= 90 && this.lifeSign.sbp < 95 && this.lifeSign.dbp >= 60 && this.lifeSign.dbp < 63) {
							this.lifeRanks = this.lifeRanks + '3';
							vitalGroups = vitalGroups + 'ee14,';
						}else if (this.lifeSign.sbp < 90 && this.lifeSign.dbp < 60) {
							this.lifeRanks = this.lifeRanks + '4';
							vitalGroups = vitalGroups + 'ee15,';
						}else if (this.lifeSign.sbp > 120 && this.lifeSign.dbp > 80) {
							this.lifeRanks = this.lifeRanks + '4';
							vitalGroups = vitalGroups + 'ee16,';
						}
					}
				}else{
					//成人类
					if (this.lifeSign.sbp > 140 && this.lifeSign.dbp < 90) {
						sdbpTip = '单纯收缩期高血压';
						this.lifeRanks = this.lifeRanks + '2';
					}else if (this.lifeSign.sbp < 80 && this.lifeSign.dbp < 60) {
						sdbpTip = '休克';
						this.lifeRanks = this.lifeRanks + '4';
						vitalGroups = vitalGroups + 'e8,';
					}else if (this.lifeSign.sbp > 90 && this.lifeSign.sbp <= 120 &&(this.lifeSign.sbp - this.lifeSign.dbp)<10) {
						sdbpTip = '休克';
						this.lifeRanks = this.lifeRanks + '4';
						vitalGroups = vitalGroups + 'e9,';
					}else if (this.lifeSign.sbp > 140 && this.lifeSign.sbp <= 150 && this.lifeSign.dbp > 90 &&(this.lifeSign.sbp - this.lifeSign.dbp)>10) {
						sdbpTip = 'Ⅰ级高血压';
						this.lifeRanks = this.lifeRanks + '2';
						vitalGroups = vitalGroups + 'e3,';
					}else if (this.lifeSign.sbp > 150 && this.lifeSign.sbp <= 160 && this.lifeSign.dbp > 90 &&(this.lifeSign.sbp - this.lifeSign.dbp)>10) {
						sdbpTip = 'Ⅰ级高血压';
						this.lifeRanks = this.lifeRanks + '2';
						vitalGroups = vitalGroups + 'e4,';
					}else if (this.lifeSign.sbp > 160 && this.lifeSign.sbp <= 180 && this.lifeSign.dbp > 90 &&(this.lifeSign.sbp - this.lifeSign.dbp)>10) {
						sdbpTip = 'Ⅱ级高血压';
						this.lifeRanks = this.lifeRanks + '3';
						vitalGroups = vitalGroups + 'e5,';
					}else if (this.lifeSign.sbp > 180 && this.lifeSign.dbp > 100 &&(this.lifeSign.sbp - this.lifeSign.dbp)>10) {
						sdbpTip = 'Ⅲ级高血压';
						this.lifeRanks = this.lifeRanks + '4';
						vitalGroups = vitalGroups + 'e6,';
					}else if (this.lifeSign.sbp > 80 && this.lifeSign.sbp < 90 && this.lifeSign.dbp < 60 &&(this.lifeSign.sbp - this.lifeSign.dbp)>10) {
						sdbpTip = '低血压';
						this.lifeRanks = this.lifeRanks + '4';
						vitalGroups = vitalGroups + 'e7,';
					}

				}
				this.vitalSigns.push({
					labelName:'bp',
					symptomName:'血压：'+this.lifeSign.sbp + '/' +this.lifeSign.dbp + 'mmHg'
				});
			}

			//一般表现——发育情况
			if(this.lifeSign.growth != ''){
				if (this.ageType != '成人') {
					//儿童类
					if (this.lifeSign.growth == "发育正常") {
						vitalGroups = vitalGroups + 'kk1,';
						this.lifeRanks = this.lifeRanks + '1';
					}else if (this.lifeSign.growth == "发育不良") {
						vitalGroups = vitalGroups + 'kk2,';
						this.lifeRanks = this.lifeRanks + '2';
					}
				}else{
					//成人类
					if (this.lifeSign.growth == "发育正常") {
						vitalGroups = vitalGroups + 'k1,';
						this.lifeRanks = this.lifeRanks + '1';
					}else if (this.lifeSign.growth == "高大型体型") {
						vitalGroups = vitalGroups + 'k2,';
						this.lifeRanks = this.lifeRanks + '2';
					}else if (this.lifeSign.growth == "矮小型体型") {
						vitalGroups = vitalGroups + 'k3,';
						this.lifeRanks = this.lifeRanks + '2';
					}
				}
				this.vitalSigns.push({
					labelName:'growth',
					symptomName:'发育情况：'+this.lifeSign.growth
				});
			}

			//一般表现——营养情况
			if(this.lifeSign.nutrition != ''){
				if (this.lifeSign.nutrition == "营养良好") {
					vitalGroups = vitalGroups + 'l1,';
					this.lifeRanks = this.lifeRanks + '1';
				}else if (this.lifeSign.nutrition == "营养中等") {
					vitalGroups = vitalGroups + 'l2,';
					this.lifeRanks = this.lifeRanks + '1';
				}else if (this.lifeSign.nutrition == "营养不良") {
					vitalGroups = vitalGroups + 'l3,';
					this.lifeRanks = this.lifeRanks + '2';
				}else if (this.lifeSign.nutrition == "营养过度:肥胖") {
					vitalGroups = vitalGroups + 'l4,';
					this.lifeRanks = this.lifeRanks + '2';
				}
				this.vitalSigns.push({
					labelName:'nutrition',
					symptomName:'营养情况：'+this.lifeSign.nutrition
				});
			}

			//一般表现——面容表情
			if(this.lifeSign.expression.length != 0){
				var adultExpressionMap = new Map();
				var childExpressionMap = new Map();
				adultExpressionMap.set("表情正常","o1");
				adultExpressionMap.set("表情抑郁","o2");
				adultExpressionMap.set("表情焦虑","o3");
				adultExpressionMap.set("急性病容","o4");
				adultExpressionMap.set("慢性病容","o5");
				adultExpressionMap.set("贫血面容","o6");
				adultExpressionMap.set("表情痛苦","o7");
				adultExpressionMap.set("肝病面容","o8.1");
				adultExpressionMap.set("肾病面容","o8.2");
				adultExpressionMap.set("甲状腺功能亢进面容","o8.3");
				adultExpressionMap.set("二尖瓣面容","o8.4");
				adultExpressionMap.set("苦笑面容","o8.5");
				adultExpressionMap.set("满月面容","o8.6");
				childExpressionMap.set("正常","oo1");
				childExpressionMap.set("急性病容","oo2");
				childExpressionMap.set("慢性病容","oo3");
				childExpressionMap.set("苍白","oo4");
				childExpressionMap.set("黄染","oo5");
				childExpressionMap.set("青紫","oo6");

				if (this.ageType != '成人') {
					//儿童类
					if (this.lifeSign.expression.join('/').indexOf("正常") >= 0) {
						this.lifeRanks = this.lifeRanks + '1';
					}else if (this.lifeSign.expression.join('/').indexOf("急性病容") >= 0 || this.lifeSign.expression.join('/').indexOf("青紫") >= 0) {
						this.lifeRanks = this.lifeRanks + '3';
					}else{
						this.lifeRanks = this.lifeRanks + '2';
					}
					vitalGroups = vitalGroups + childExpressionMap.get(this.lifeSign.expression.join('/')) + ',';
				}else{
					//成人类
					if (this.lifeSign.expression.join('/').indexOf("表情正常") >= 0) {
						this.lifeRanks = this.lifeRanks + '1';
					}else if (this.lifeSign.expression.join('/').indexOf("急性病容") >= 0 || this.lifeSign.expression.join('/').indexOf("贫血面容") >= 0 || this.lifeSign.expression.join('/').indexOf("表情痛苦") >= 0) {
						this.lifeRanks = this.lifeRanks + '3';
					}else{
						this.lifeRanks = this.lifeRanks + '2';
					}
					vitalGroups = vitalGroups + adultExpressionMap.get(this.lifeSign.expression.join('/')) + ',';
				}
				this.vitalSigns.push({
					labelName:'spirit',
					symptomName:'面容表情：'+this.lifeSign.expression.join('/')
				});
			}

			//一般表现——体位
			if(this.lifeSign.position.length != 0){
				var positionMap = new Map();
				positionMap.set("自动体位","p1");
				positionMap.set("被动体位","p2");
				positionMap.set("强迫体位/强迫仰卧位","p3.1");
				positionMap.set("强迫体位/强迫侧卧位","p3.2");
				positionMap.set("强迫体位/端坐位","p3.3");
				positionMap.set("强迫体位/强迫蹲位","p3.4");
				positionMap.set("强迫体位/强迫停立位","p3.5");
				positionMap.set("强迫体位/辗转体位","p3.6");
				positionMap.set("强迫体位/角弓反张位","p3.7");
				if (this.lifeSign.position.join('/').indexOf('自动体位') < 0) {
					if (this.lifeSign.position.join('/').indexOf('角弓反张位') >= 0) {
						this.lifeRanks = this.lifeRanks + '4';
					}else{
						this.lifeRanks = this.lifeRanks + '3';
					}
				}
				vitalGroups = vitalGroups + positionMap.get(this.lifeSign.position.join('/')) + ',';
				this.vitalSigns.push({
					labelName:'position',
					symptomName:'体位：'+this.lifeSign.position.join('/')
				});
			}
			this.vitalGroups = ","+vitalGroups;
			this.$store.commit({
				type: "setVitalGroups",
				vitalGroups: vitalGroups
			});
			this.$store.commit({
				type:"setVitalSignData",
				vitalSignData: {
					temperature: this.lifeSign.temperature,
					pulse: this.lifeSign.pulse,
					breath: this.lifeSign.breath,
					sbp: this.lifeSign.sbp,
					dbp: this.lifeSign.dbp,
					diseaseTime: this.diseaseTime,
					timeUnit: this.timeUnit,
					scene: this.lifeSign.scene,
					growth: this.lifeSign.growth,
					nutrition: this.lifeSign.nutrition,
					expression: this.lifeSign.expression.join('/'),
					position: this.lifeSign.position.join('/'),
					handlePlace: this.handlePlace,
					allergy:this.lifeSign.allergy.join('/')
				}
			});
		},
		rebindData:function(){
			var vm = this;
			$.ajax({
                    type:"get",
                    url:CONST.url+"getRecordById",
                    data:{"recordId": vm.curChecking.recordId},
                    success:function(result){
                        if (result.code==0||result.code=='0') {
                        	//获取到需要复原的数据对象recordDiseaseTime
                        	var queryRecord = result.data;
                        	if (queryRecord.recordDiseaseTime) {
                        		if (queryRecord.recordDiseaseTime==0) {
                        			vm.diseaseTime = "";
                        			vm.timeUnit = ""
                        		}else if (queryRecord.recordDiseaseTime%518400==0) {
                        			vm.diseaseTime = queryRecord.recordDiseaseTime/518400;
                        			vm.timeUnit = "年"
                        		}else if (queryRecord.recordDiseaseTime%43200==0) {
                        			vm.diseaseTime = queryRecord.recordDiseaseTime/43200;
                        			vm.timeUnit = "月"
                        		}else if (queryRecord.recordDiseaseTime%1440==0) {
                        			vm.diseaseTime = queryRecord.recordDiseaseTime/1440;
                        			vm.timeUnit = "天"
                        		}else if (queryRecord.recordDiseaseTime%60==0) {
                        			vm.diseaseTime = queryRecord.recordDiseaseTime/60;
                        			vm.timeUnit = "小时"
                        		}else{
                        			vm.diseaseTime = queryRecord.recordDiseaseTime;
                        			vm.timeUnit = "分钟"
                        		}
                        	}
                        	vm.handlePlace = queryRecord.recordTreatPlace?queryRecord.recordTreatPlace:"";
                        	vm.lifeSign.nutrition = queryRecord.recordNutrition?queryRecord.recordNutrition:"";
                        	vm.lifeSign.position = queryRecord.recordPosition?queryRecord.recordPosition.split("/"):[];
                        	vm.lifeSign.growth = queryRecord.recordGrowth?queryRecord.recordGrowth:"";
                        	vm.lifeSign.dbp = queryRecord.recordDbp?queryRecord.recordDbp:"";
                        	vm.lifeSign.sbp = queryRecord.recordSbp?queryRecord.recordSbp:"";
                        	vm.lifeSign.breath = queryRecord.recordBreath?queryRecord.recordBreath:"";
                        	vm.lifeSign.pulse = queryRecord.recordPulse?queryRecord.recordPulse:"";
                        	vm.lifeSign.temperature = queryRecord.recordTemperature? queryRecord.recordTemperature:"";
                        	vm.lifeSign.scene = queryRecord.recordSense?queryRecord.recordSense:"";
                        	vm.lifeSign.expression = queryRecord.recordExpression?queryRecord.recordExpression.split("/"):[];
                        	vm.$store.commit({
								type: "setRecordData",
								recordData: queryRecord
							});
							// if (!queryRecord.recordMainCode) {
							// 	vm.isRealTime = true;
							// }else{
							// 	vm.isRealTime = false;
							// }
							vm.isRealTime = false;
                        }else{
                        	alert("获取患者数据出错:"+result.msg);
                        }
                    },
                    error:function(){
                    	alert("请求患者信息失败！");
                    }
                });
		},
		getChecking:function(){
			console.log("根据用户去查询检查中患者："+this.curUser.userName);
			var vm = this;
			$.ajax({
                    type:"get",
                    url:CONST.url+"getCheckByDoctor",
                    data:{"recordDoctor": vm.curUser.userName+"-"+vm.curUser.userCode},
                    success:function(result){
                        if (result.code==0||result.code=='0') {
                        	vm.checking = result.data;
                        }else{
                        	vm.$notify.error({
					          title: '错误',
					          message: '检查中患者信息请求失败'
					        });
                        }
                    },
                    error:function(){
                    	vm.$notify.error({
					          title: '错误',
					          message: '网络异常，检查中患者信息请求失败'
					        });
                    }
                });
		},
		initEmergency:function(){
			var vm =this;
			$.ajax({
                    type:"get",
                    url:CONST.url+"queryEAGroup",
                    success:function(result){
                        if (result.code==0||result.code=='0') {
                        	vm.emergencyGroup = result.data;
                        }else{
                        	vm.$notify.error({
					          title: '错误',
					          message: '紧急规则初始化失败'
					        });
                        }
                    },
                    error:function(){
                    	vm.$notify.error({
					          title: '错误',
					          message: '网络异常，紧急规则初始化失败'
					        });
                    }
                });
		},
		checkHaveER:function(vitalContent){
			for(var i =0;i<this.emergencyGroup.length;i++){
				var group = this.emergencyGroup[i];
				var flag = true;
				group.groupContent.split(",").forEach(function(item){
					if (item!=""&&vitalContent.indexOf(','+item+',')<0) {
						flag = false;
					}
				});
				if (flag) {
					return true;
				}
			}
			return false;
		}
	},
	created: function () {
			this.getChecking();
            setInterval(this.getChecking, 600000);
            this.initEmergency();
        },
	watch:{
		lifeSign:{
			handler(curVal,oldVal){
			this.getVitalSigns();
			this.$store.commit({
				type: "setVitalSignList",
				vitalSignList: this.vitalSigns
			});
			this.$store.commit({
				type: "setVitalLights",
				vitalLights: this.lifeRanks
			});
			// //判断当前的生命体征组合中，是否存在紧急处置
			// if (this.checkHaveER(this.vitalGroups)) {
			// 	this.$store.commit({
			// 				type: "setFirstVisit",
			// 				firstVisit: {
			// 					timeStamp:new Date().getTime()
			// 				}
			// 		});
			// }else{
			// 	//如果生命体征无紧急，但是已经存在有紧急疾病，则再次加载
			// 	//need TODO 目前是放开的，后期优化需判断
			// 	if (true) {
			// 		this.$store.commit({
			// 				type: "setFirstVisit",
			// 				firstVisit: {
			// 					timeStamp:new Date().getTime()
			// 				}
			// 		});
			// 	}
			// }
			//如果是回调就禁止生命体征实时诊断，
			if (this.isRealTime) {
				this.$store.commit({
					type: "setFirstVisit",
					firstVisit: {
						timeStamp:new Date().getTime()
					}
				});
			}else{
				this.isRealTime = true;
			}

		},
		deep: true 
		},
		ageType:{
			handler(curVal,oldVal){
				console.log("当前年龄：" + curVal);
				if(this.ageType != '成人'){
					this.scenes = this.childSenses;
					this.expressions = this.childExpressions;
					this.growths = this.childGrowths;
				}else{
					this.scenes = this.adultSenses;
					this.expressions = this.adultExpressions;
					this.growths = this.adultGrowths;
				}
			}
		},
		referralHospital:{
				handler(curValue,oldValue){
					if (curValue.join('/').indexOf('其他') >= 0) {
						this.isShowElse = true;
					}else{
						this.isShowElse = false;
					}
				}
			},
		diseaseTime:{
				handler(curVal,oldVal){
					this.getVitalSigns();
				}
			
		},
		timeUnit:{
				handler(curVal,oldVal){
					this.getVitalSigns();
				}
		},
		handlePlace:{
				handler(curVal,oldVal){
					this.getVitalSigns();
				}
		}
	}
}
</script>
<style type="text/css" scoped>
.el-row{
	margin-top: 5px;
	margin-bottom: 5px;
	text-align: left;
	line-height: 40px;
}
.title{
	text-align: right;
}
</style>